//****************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//* $$Workfile:   MixTempFindQuery.java  $$
//* $$Revision:   1.1  $$
//* $$Author:   aponte  $$
//* $$Date:   Dec 10 2008 11:13:54  $$
//*
//*****************************************************************
package ar.com.ford.it.fullEconomics.persistence.dao.query;

import oracle.toplink.expressions.ExpressionBuilder;
import oracle.toplink.queryframework.ReportQuery;
import com.ford.it.persistence.impl.toplink.ReportDefinition;

public class MixTempFindQuery implements ReportDefinition {

	public void configureQuery(ReportQuery report, Object[] parameters) {
		ExpressionBuilder builder = report.getExpressionBuilder();

		//Agrego los atributos de la parte
		report.addAttribute("eesp08PartClassCodeC");
		report.addAttribute("eesp08PartPrefixCodeC");
		report.addAttribute("eesp08PartBaseCodeC");
		report.addAttribute("eesp08PartSuffixCodeC");
		
		//Agrego los atributos del catalogo
		report.addAttribute("eesp08CatalModelyearCodeC");
		report.addAttribute("eesp08CatalSeqCodeC");
		report.addAttribute("eesp08CatalTmaCodeC");		

		report.addSum("eesp08UsageQuantityQ", builder.get("eesp08UsageQuantityQ"));

		//agrego el group by de parte
		report.addGrouping(builder.get("eesp08PartClassCodeC"));
		report.addGrouping(builder.get("eesp08PartPrefixCodeC"));
		report.addGrouping(builder.get("eesp08PartBaseCodeC"));
		report.addGrouping(builder.get("eesp08PartSuffixCodeC"));
		
		//agrego el group by de catalogo
		report.addGrouping(builder.get("eesp08CatalModelyearCodeC"));
		report.addGrouping(builder.get("eesp08CatalSeqCodeC"));
		report.addGrouping(builder.get("eesp08CatalTmaCodeC"));

	}

}
